from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *

import json
from ui.Frm_Set import Ui_Frm_Set

import Constant as C
import Function as F

class Uipy_frm_set(QWidget,Ui_Frm_Set):
    def __init__(self,parent=None):
        super(Uipy_frm_set, self).__init__(parent)
        self.setupUi(self)


        self.cB_CheckUpate.clicked.connect(self.setcheckUpdate)

    def showEvent(self, QShowEvent):
        self.cB_CheckUpate.setChecked(C.checkForUpdate)

    def setcheckUpdate(self):
        F.changeConfig('启动检查更新',self.cB_CheckUpate.isChecked())
        C.checkForUpdate = self.cB_CheckUpate.isChecked()